package com.to8to.scene.util;

public class LogUtil
{
    public static String logStackTrace(Throwable e)
    {
        StringBuffer sb = new StringBuffer();
        sb.append("\n");
        sb.append(e);
        sb.append("\n");
        StackTraceElement[] trace = e.getStackTrace();
        for (StackTraceElement traceElement : trace)
        {
            sb.append("\tat " + traceElement);
            sb.append("\n");
        }
        Throwable ourCause = e.getCause();
        if (ourCause != null)
        {
            sb.append("\n");
            sb.append(ourCause);
            sb.append("\n");
        }
        return sb.toString();
    }
}
